package csdn.yichang.li01;

public class Test3 {
    public static void main(String[] args) {
        int r=getNum(10,0);
        int r2=getNum(new Integer(10),new Integer(0) );
        System.out.println(r);
    }

    private static int getNum(int i, int j) {
        System.out.println("int");
         int n;
        try {
            n=i/j;
            System.out.println(n);
        } catch (Exception e) {
            e.printStackTrace();
            n=20;
            System.out.println(n);
            //先建立了返回通道n=20
            //然后进入finally----n=30
            //但是不影响return
            //如果没有return r将会变成30；
            return n;
        }finally{            
            n=30;
            System.out.println("finally");
            System.out.println(n);
            return n;
        }
       
    }
    private static int getNum(Integer i, Integer j) {
        System.out.println("Integer");
        throw new UnsupportedOperationException("Unimplemented method 'getNum'");
    }
}
